{% extends "account/base.html" %}

{% load i18n %}

{% block head_title %}{% trans "OpenID Associations" %}{% endblock %}

{% block body %}
    <h1>{% trans "Manage OpenID Associations" %}</h1>
    {% url acct_passwd_set as acct_passwd_set_url %}
    {% if not request.user.password %}
    <strong>{% blocktrans %}You have not set a password for this user account. You are unable to remove OpenID associations until you <a href="{{ acct_passwd_set_url }}">set a password</a>.{% endblocktrans %}</strong>
    {% endif %}
    {% if openids %}
    <p>{% blocktrans with del_buttons|pluralize as buttons %}Your account is currently associated with the following OpenID {{ buttons }}:{% endblocktrans %}</p>
    {% for openid in openids %}
    <form action="{{ action }}" method="POST">
        {% csrf_token %}
        <p>
            {{ openid.openid }}
            {% if request.user.password %}
            - <input type="hidden" name="todelete" value="{{ openid.button }}" />
              <input type="submit" value="{% trans "Remove association" %}" />
            {% endif %}
        </p>
    </form>
    {% endfor %}
    {% endif %}
    
    <p>{% trans "To associate a new OpenID with this account, sign in with it here:" %}</p>
    
    <form action="{{ action_new }}" method="POST">
        {% csrf_token %}
        <p>
            <input type="text" name="openid_url" value="" />
            <input type="hidden" name="next" value="{{ associate_next }}">
            <input type="submit" value="{% trans "Authenticate and associate with this account" %}" />
        </p>
    </form>
{% endblock %}